package thread;

import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) {
        System.out.println("开始");
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入倒计时的数字:");
        int n = scanner.nextInt();
        try {
            for (int i = n; i >=0; i--) {
                System.out.println(i);
                Thread.sleep(1000);
            }
            System.out.println("倒计时结束");

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("结束");
    }
}
